package com.harth.flutter_ns_ble

import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result

/** FlutterNsBlePlugin */
class FlutterNsBlePlugin : FlutterPlugin, MethodCallHandler {

    private lateinit var peripheralManager:PeripheralManager
    override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
        peripheralManager = PeripheralManager(flutterPluginBinding.applicationContext)
        PeripheralMethod.setUp(flutterPluginBinding.binaryMessenger, peripheralManager)
        ProvidePeripheralEventStreamHandler.register(flutterPluginBinding.binaryMessenger, peripheralManager)
        ProvideLogEventStreamHandler.register(flutterPluginBinding.binaryMessenger, peripheralManager.logEventHandler)
    }

    override fun onMethodCall(call: MethodCall, result: Result) {

    }

    override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
    }


}
